/-app
TopLayout.ts
main.css
start.ts
/-docs ...
/-docs/types ...
text.ts
api.ts
/-files
FileTree.ts
SyncStorageAccess.ts
/-imports
/-storage
/-typings
errors.js
functions.ts
index.html
try.js
xxxxxxxxxx
 
1
module teapo.docs.types.text {
2
  
3
  export function load(fullPath: string, read: (property: string) => string, write: (property: string, content: string) => void): DocumentHandler {
4
    
5
    return null;
6
    
7
  }
8
  
9
  var editorCache: { cm: CodeMirror; host: HTMLElement; } [] = [];
10
  
11
  export class TextDocumentHandler implements DocumentHandler {
12
​
13
    private _doc: CodeMirror.Doc = null;
14
​
15
    constructor(
16
      private _read: (property: string) => string,
17
      private _write: (property: string, content: string) => void) {
18
      
19
      var text = this._read(null);
20
      this._doc = new CodeMirror.Doc(text);
21
​
22
      // TODO: process history and/or cusor/scroll position
23
    }
24
​
25
    open(): HTMLElement {
26
​
27
      if (editorCache.length) { 
28
      }
29
      
30
    }
31
​
32
    close() { 
33
    }
34
​
35
  }
36
  
37
  function createEditor(): CodeMirror {
38
  }
39
  
40
}
26:0